package com.neuedu.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 项目    ： spring-mvc-java1
 * 创建时间 ：2020/3/25  14:53 25
 * author  ：jshand-root
 * site    :  http://314649444.iteye.com
 * 描述     : 测试控制器
 */
@Controller
public class HelloController {


    /**
     * http://localhost:8080/web/helloworld
     * @param request
     * @param response
     * @throws IOException
     */
    @RequestMapping(value={"/helloworld","/helloworld2"})
    public void test(HttpServletRequest request, HttpServletResponse response,int age,String name) throws IOException {
        System.out.println("后台Controller执行");

        PrintWriter out = response.getWriter();
        out.write("success");
        out.flush();
        out.close();

    }

    @RequestMapping("/helloworld2")
    public void test2(HttpServletRequest request, HttpServletResponse response) throws IOException {
        System.out.println("后台Controller执行");

        PrintWriter out = response.getWriter();
        out.write("success");
        out.flush();
        out.close();

    }
}